import { networkRequest, baseRequestConfig, sessionConfig, development, uploadFileConfig } from './RequestConfig'


//获取session
export const getSession = (params) => {
    sessionConfig.url = '/risk/main/000_000_000'
    sessionConfig.data = params
    return networkRequest(
        sessionConfig
    )
}

//获取验证码
export const getVerificationCode = (params) => {
    baseRequestConfig.url = '/risk/main/000_000_002'
    baseRequestConfig.data = params
    return networkRequest(
        baseRequestConfig
    )
}

//登录
export const login = (params) => {
    baseRequestConfig.url = '/risk/main/000_000_001'
    baseRequestConfig.data = params
    return networkRequest(
        baseRequestConfig
    )
}

//获取用户基础信息
export const getUserBaseInfo = (params) => {
    baseRequestConfig.url = '/risk/main/000_000_005'
    baseRequestConfig.data = params
    return networkRequest(
        baseRequestConfig
    )
}


//查询所有网点信息
export const queryBranch = (params) => {
    baseRequestConfig.url = '/risk/main/000_000_011'
    baseRequestConfig.data = params
    return networkRequest(
        baseRequestConfig
    )
}


//文件上传下载前置接口，获取验证码
export const getAuthCode = (params) => {
    baseRequestConfig.url = '/risk/main/000_001_000'
    baseRequestConfig.data = params
    return networkRequest(
        baseRequestConfig
    )
}

//下载网点支行文件
export const dowanloadBranchTemplateUrl = (authCode) => {
    return development + '/risk/main/000_001_001?authCode=' + authCode
}

//网点模板上传
export const uploadBranchTemplate = (params) => {
    uploadFileConfig.url = '/risk/main/000_001_002';
    uploadFileConfig.authCode = params.get('authCode');
    uploadFileConfig.data = params.get('formData');
    return networkRequest(uploadFileConfig)
}

//获取取现记录
export const getRecord = (params) => {
    baseRequestConfig.url = '/risk/main/000_000_012'
    baseRequestConfig.data = params
    return networkRequest(
        baseRequestConfig
    )
}

//导出取现记录
export const exportRecord = (authCode, startTime, endTime) => {
    return development + '/risk/main/000_001_003?authCode=' + authCode + "&startTime=" + startTime + "&endTime=" + endTime
}


